import globals from 'globals'
import pluginJs from '@eslint/js'
import tseslint from 'typescript-eslint'

/** @type {import('eslint').Linter.Config[]} */
export default [
  { files: ['**/*.{js,mjs,cjs,ts}'] },
  { ignores: ['node_modules', 'dist'] },
  {
    languageOptions: {
      globals: { ...globals.browser, ...globals.node },
      parser: tseslint.parser // use typescript-eslint parser
    }
  },
  pluginJs.configs.recommended,
  ...tseslint.configs.recommended,
  // .map(({ rules }) => ({
  //   ...rules,
  //   '@typescript-eslint/no-explicit-any': 'off'
  // }))
  {
    rules: {
      '@typescript-eslint/no-explicit-any': 'off' // disable no-explicit-any rule
    }
  }
]
